rendernodepaintable: Fix clipping
authorBenjamin Otte <otte@redhat.com>
Wed, 5 Sep 2018 14:24:25 +0000 (16:24 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 5 Sep 2018 14:25:07 +0000 (16:25 +0200)
We need to translate before clipping, otherwise we clip in totally the
wrong place.

gtk/gtkrendernodepaintable.c

index 2d7248e2f401133b621d004f1fb955103f3eedf4..35fcd2f545c12e35f374ee92e732fa1274ce7e11 100644 (file)
@@ -60,14 +60,17 @@ gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable,
                                    &transform);
     }
 
-  gtk_snapshot_push_clip (snapshot, &self->bounds);
   gtk_snapshot_offset (snapshot, -self->bounds.origin.x, -self->bounds.origin.y);
 
+  gtk_snapshot_push_clip (snapshot, &self->bounds);
+
   gtk_snapshot_append_node (snapshot, self->node);
+  //gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 1, 0, 0, 1 }, &self->bounds);
 
-  gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
   gtk_snapshot_pop (snapshot);
 
+  gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
+
   if (needs_transform)
     gtk_snapshot_pop (snapshot);
 }